<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<html>
<head>
   <script type="text/javascript">
       function f1() {
           //内容选择器，内部有标签不构成影响
           console.log($('div:contains(xiamen)').html())
           $('div:empty').html('空节点')
           console.log($('div:has(p)').html())
           console.log($('div:parent'))
       }
   </script>
</head>
<body>
    <h2>内容过滤器</h2>
    <div> I love <span>xiamen</span></div>
    <div> I love China</div>
    <div></div>
    <div>sun</div>
    <div><p>hello</p></div>
    <input type="button" value="触发" onclick="f1()">
</body>
</html>
